package com.douqu.game.core.util;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2018-01-28 15:49
 */
public class EncryptUtils {

    private final static int KEY = 0xf9;

    public static String encode(String value)
    {
        char[] ary = value.toCharArray();
        for(int i = 0; i < ary.length; i++)
        {
            ary[i] = (char) (ary[i] ^ KEY);
        }

        return new String(ary);
    }

    public static String decode(String value)
    {
        char[] ary = value.toCharArray();
        for(int i = 0; i < ary.length; i++)
        {
            ary[i] = (char) (ary[i] ^ KEY);
        }

        return new String(ary);
    }


}
